// 1.引入express框架
const express = require('express');
// 2.引入路径模块
const path = require('path');
// const http = require('http');
// 3.创建应用对象
const app = express();

// 拦截所有请求实现跨域
app.use((req, res, next) => {
	res.header('Access-Control-Allow-Origin', '*');
	next();
})
app.all('/elastic', (req, res) => {
	const data = [
		1,2,3,4,5
	]
	res.send(data)
})
app.listen(8000, () => {
	console.log('服务已经启动, 8000 端口监听中...')
})
